#include <assert.h>
#include <stdio.h>

/*
 * some debug skill functions defined here.
 *
 */

#define return_if_fail(p)                                                   \
    if (!(p)){                                                              \
        printf("%s:%d warning: "#p" failed. \n", __func__, __LINE__);       \
        return;                                                             \
    }

#define return_val_if_fail(p, ret)                                          \
    if (!(p)){                                                              \
        printf("%s:%d warning: "#p" failed. \n", __func__, __LINE__);       \
        return (ret);                                                       \
    }


#define LOG( format, ... ) printf( format, __VA_ARGS__ )


int main()
{
    //assert takes no effect when defined -D NDEBUG 
    LOG("%s: %d\n", "hello", 0);
    assert(1 == 0);
    return_val_if_fail(1==0, 0);
    return 0;
}
